<?php

/*

  Action	$2

  +2 Actions
  Choose one: Set aside the top card of your deck face down on your Native Village mat;
  or put all the cards from your mat into your hand.
  You may look at the cards on your mat at any time; return them to your deck at the end of the game.


 */

class NativeVillage extends Card implements iAction, iKingdom, iSeaside {

    public function __construct() {
        parent::__construct("Native Village", 2);
        $this->undoPlay = false;
        $this->undoBuy = true;
    }

    public function getDescription() {
        return array(
            "+2 Actions",
            "Choose one: Set aside the top card of your deck face down on your Native Village mat, or put all the cards from your mat into your hand.",
            "You may look at the cards on your mat at any time; return them to your deck at the end of the game.");
    }

    public function play(Game $game, $isRealCard) {
        $game->addActions(2);
        ScreenDisplay::addScreenMessage($game, true, "get  +2 actions", "gets +2 actions");

        $options = array(new Option(1, "Put card on  mat"), new Option(2, "Take cards from mat"));
        $output = MySocket::GetUserReply($game, Input_ChooseOne, $options, 1, 1, null, "Please choose");
        $answer = $output[0];
        if ($answer == "Put card on  mat") {
            $card = $game->removeCardFromDrawDeck();
            if ($card) {
                $game->putCardInNativeVillageDeck($card);
                ScreenDisplay::addScreenMessage($game, true, "put " . niceprint($card) . " to Native Village mat", "puts 1 card to Native Village mat");
            } else {
                ScreenDisplay::addScreenMessage($game, true, "put nothing to Native Village mat", "puts nothing to Native Village mat");
            }
        } else {
            $cards = $game->PutCardsFromNativeVillageDeckToHand();
            ScreenDisplay::addScreenMessage($game, true, "put " . niceprint($cards) . " from Native Village mat in your hand", "puts " . sizeof($cards) . " cards from Native Village mat in his hand");
        }
        $game->cardActionFinished();
        return true;
    }

}

?>